package com.twotiger.and.browser;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.webkit.ConsoleMessage;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.ProgressBar;
import app.twotiger.p2p.R;

import com.twotiger.and.activity.base.SubTitle;

/**
 * webView
 * @Description: TODO(这里描述这个类的作用) 
 * @Author douxy
 * @Date 2015年8月18日 下午8:59:58
 */
public class BrowserActivity extends Activity {

    private WebChromeClient client;
    private WebView mWebView;
    private ProgressBar progressBar;
    private SubTitle title;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.browser_layout);
        mWebView = (WebView) findViewById(R.id.browser_webview);
        progressBar = (ProgressBar) findViewById(R.id.browser_progressbar);
        title = new SubTitle(getWindow().getDecorView()) {
            @Override
            protected void clickTitle(View v) {
            }

            @Override
            protected void clickRightBtn(View v) {
            }

            @Override
            protected void cickLeftBtn(View v) {
            }
        };
        client = new TTWebChromeClient();
        mWebView.setWebChromeClient(client);
        mWebView.getSettings().setSupportZoom(false);
        mWebView.getSettings().setJavaScriptEnabled(true);
        super.onCreate(savedInstanceState);
    }

    class TTWebChromeClient extends WebChromeClient {
        @Override
        public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
            return super.onConsoleMessage(consoleMessage);
        }

    }
}
